{extend name="common/base_page" /}

{block name="title"}出库详情{/block}

{block name="jscssfile"}{/block}

{block name="css"}
<style type="text/css">
body{ background: #ffffff; height:100vh; }
.layui-fluid {
    padding-top: 5px;
}
.layui-table td{
  padding: 9px 5px;
  font-size: 13px;
}
input:disabled { background:#f0efef; }
.layui-form-item { margin-bottom: 0px; }
</style>
{/block}

{block name="body"}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-card-body public-tpl-row1" style="padding: 0px;">
        <form class="layui-form" action="" id="info-form" lay-filter="info-form" onsubmit="return false;">
        <fieldset class="layui-elem-field layui-field-title"><legend>出库信息</legend></fieldset>
        <div class="layui-form-item">
            <div class="layui-inline"><label class="layui-form-label">出库日期</label>
                <div class="layui-input-inline" style="width:300px;">
                  <label class="layui-form-label" style="width:280px;text-align: left;">{$info.create_time}</label>
                </div>
            </div>
            <div class="layui-inline"><label class="layui-form-label">出库方式</label>
                <div class="layui-input-inline" style="width:300px;">
                    <label class="layui-form-label" style="width:280px;text-align: left;">{$info.entry_sub_type_txt}</label>
                </div>
            </div>
            <div class="layui-inline"><label class="layui-form-label">领用科室</label>
                <div class="layui-input-inline" style="width:300px;">
                  <label class="layui-form-label" style="width:280px;text-align: left;">{$info.out_keshi}</label>
                </div>
            </div>
            
        </div>
        <div class="layui-form-item">
            <div class="layui-inline"><label class="layui-form-label">领用人员</label>
                <div class="layui-input-inline" style="width:300px;">
                  <label class="layui-form-label" style="width:280px;text-align: left;">{$info.out_renyuan}</label>
                </div>
            </div>
            <div class="layui-inline"><label class="layui-form-label">出库备注</label>
                <div class="layui-input-inline" style="width:300px;">
                  <label class="layui-form-label" style="width:280px;text-align: left;">{$info.remarks}</label>
                </div>
            </div>
            <div class="layui-inline"><label class="layui-form-label">出库总金额</label>
                <div class="layui-input-inline" style="width:300px;">
                  <label class="layui-form-label" style="width:280px;text-align: left;">{$info.total_price}</label>
                </div>
            </div>
        </div>
        <fieldset class="layui-elem-field layui-field-title"><legend>出库项目明细</legend></fieldset>
        
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body" style="margin-top:5px;padding:0px 0px;height: 570px;overflow-y: scroll;">
                        <table class="layui-table">
                          <colgroup>
                            <col width="200">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="60">
                            <col width="115">
                            <col width="115">
                            <col width="110">
                            <col width="120">
                            <col>
                          </colgroup>
                          <thead>
                            <tr>
                              <th>名称</th>
                              <th>规格</th>
                              <th><i class="c-red">*</i>出库数量</th>
                              <th>库存数量</th>
                              <th>单位</th>
                              <th>零售单价（元）</th>
                              <th>进货单价(元)</th>
                              <th>批号</th>
                              <th>有效期</th>
                            </tr>
                          </thead>
                          <tbody id="subListBox">
                          {volist name="table_list" id="vo"}
                            <tr>
                                <td>{$vo.name}</td>
                                <td>{$vo.spec}</td>
                                <td><input type="text" id="tr_iptnum_{$vo.id}" autocomplete="off" class="layui-input" value="{$vo.num}" style="height: 28px;" disabled="true"></td>
                                <td>{$vo.ext_json.num}</td>
                                <td>{$vo.unit}</td>
                                <td>{$vo.ls_price}/{$vo.unit}</td>
                                <td>{$vo.price}/{$vo.unit}</td>
                                <td>{$vo.batch_sn}</td>
                                <td>{$vo.except_time}</td>
                            </tr>
                          {/volist}
                          </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <div class="layui-form-item layui-layout-admin">
              <div class="layui-input-block">
                <div class="layui-footer" style="left: 0;">
                  {if $info.status elt 0}
                  <button class="layui-btn" lay-submit="" lay-filter="info-form-savebtn1">确认出库</button>
                  {/if}
                  <a class="layui-btn layui-btn-danger" href="{:url('index/store.outstore/index')}">返回</a>
                </div>
              </div>
            </div>
            <input type="hidden" name="id" value="{$info.id}"/>
        </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
$(function(){
  setTimeout(function(){
    {if $info.status elt 0}
    //出库确认数据
    layform.on('submit(info-form-savebtn1)', function(data){
      layer.confirm('您确认本条数据正确无误吗？', {
          title:'出库确认',shade:[0.4,'#000000'],btn: ['确认','取消'] //按钮
      }, function(){
          layer.closeAll();
          _Index.ajax("{:url('index/store.outstore/confim')}",{id:'{$info.id}'},function(d){
              if(d.err == 0)
              {
                  layer.msg(d.msg, {time: 1000},function(){
                    window.location.reload();
                  });
              }else{
                  layer.msg(d.msg, {time: 2000,anim: 4});
              }
          },'请稍候...');
      });
      return false;
    });
    {/if}
    layform.render();
  },50);
});
</script>
{/block}